from redis import Redis


class RedisDB:
    """"""
    def __init__(self, **kwargs):
        self.redis = None
        if kwargs:
            self.init(**kwargs)

    def init(self, **kwargs):
        self.redis = Redis(**kwargs)


rdb = RedisDB()


if __name__ == '__main__':
    rdb.init(host='192.168.101.79', password='MY.io2019')

    def test_redis():
        a = rdb.redis.get('a')
        print(a)


    test_redis()
